#import json5 as json
import json
import sys

args = sys.argv
#print(args)
args = args[1:]
assert len(args)>0

def recursive_get(target,curlist=[]):
    assert type(curlist) == list
    if curlist == []:
        print(target)
    else:
        cursor = curlist[0]
        try:
            cursor = int(cursor)
        except:
            pass
#        print("target:", target)
#        print("reading field:", cursor)
        target = target[cursor]
        curlist = curlist[1:]
        recursive_get(target,curlist)

target = ""
for x in sys.stdin.read():
    target+=x
#print(target)
#target = target.replace("\n","").replace("\r","")
#print(target)
target = json.loads(target)
#print(target)
recursive_get(target,args)
